﻿using System;
using System.Data;
using System.Data.SqlClient;
using JetBrains.Annotations;

namespace StreetPacMan.Server.Tests
{
    public class ConnectionProviderFactory
    {
        public static IConnectionProvider GetConnectionProvider()
        {
            return new TestsConnectionProvider();
        }
    }

    [UsedByIoc]
    public class TestsConnectionProvider : IConnectionProvider
    {
        public IDbConnection GetConnection()
        {
            return new SqlConnection(
                string.Format(@"Data Source=.\SQLEXPRESS;AttachDbFilename={0}\PacManTestsDatabase.mdf;Integrated Security=True;User Instance=True", Environment.CurrentDirectory));
            //"Data Source=msowv187.012hosting.com;Initial Catalog=guystei_pacman;Persist Security Info=True;User ID=guystei_pacman;Password=s123456");
        }
    }
}